	
		<?php 
			$posttype = get_post_meta(get_the_ID(), '_portfolio_posttype_select', true);	
			
			$full_size = get_the_image( array( 'format' => 'array', 'echo' => false, 'custom_key' => array( 'Thumbnail', 'thumbnail' ), 'default_size' => 'full' ) ); 				
			$thumb = get_the_image( array( 'format' => 'array', 'echo' => false, 'custom_key' => array( 'Thumbnail', 'thumbnail' ), 'default_size' => $thumb_size, 	'default_image' => get_bloginfo ( 'template_url' ) . '/images/'. $no_pic) );  

			if($posttype == 'video') { ?>
				<div class="entry-img">											
					<a href="<?php echo get_post_meta(get_the_ID(), '_portfolio_videolink_text', true); ?>" class="pf-video iframe">
						<?php if($bPortfolio != true) { ?>
							<div class="entry-icon <?php echo $posttype;?>"></div>							
						<?php } ?>
						<div class="entry-icon-overlay <?php echo $posttype;?>-overlay"></div>
						<strong></strong>
						<img src="<?php echo $thumb['src']; ?>" alt="<?php the_title(); ?>"/>
					</a>										
				</div><!-- .entry-img -->
			<?php } elseif($posttype == 'gallery') { ?>
				<div class="entry-img">					
					<a rel="group-<?php the_ID(); ?>" href="<?php echo $full_size['src']; ?>" title="<?php the_title(); ?>" style="z-index:10;">
						<?php if($bPortfolio != true) { ?>	
							<div class="entry-icon <?php echo $posttype;?>"></div>	
						<?php } ?>
						<div class="entry-icon-overlay <?php echo $posttype;?>-overlay"></div>						
						<strong></strong>
						<img src="<?php echo $thumb['src']; ?>" alt="<?php the_title(); ?>"/>
					</a>
					<?php														
					$attachments = get_children( array( 'post_parent' => get_the_ID(), 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) );
					foreach ( $attachments as $id => $attachment ) {					
						$image = wp_get_attachment_image_src( $id, 'full' ); ?>
						<a rel="group-<?php the_ID(); ?>" href="<?php echo $image[0]; ?>" title="<?php echo trim( strip_tags( get_post_field( 'post_excerpt', $id ) ) ); ?>"></a>
					<?php } ?>									
															
				</div><!-- .entry-img -->
			<?php } else { ?>
				<div class="entry-img">									
					<a class="pf-post" href="<?php echo $full_size['src']; ?>" title="<?php the_title(); ?>">
						<?php if($bPortfolio != true) { ?>
							<div class="entry-icon <?php echo 'post';?>"></div>
						<?php } ?>	
						<div class="entry-icon-overlay <?php echo 'post';?>-overlay"></div>
						<strong></strong>
						<img src="<?php echo $thumb['src']; ?>" alt="<?php the_title(); ?>"/>
					</a>											
				</div><!-- .entry-img -->
			<?php } ?>